<div class="typography">
    <!-- container-wrap -->
    <div class="container">
        <form action="{:url('ext/upload/uType')}" method="post" style="min-height:400px;" enctype="multipart/form-data">
            <h3 class="hdg">Forms</h3>
            <div class="input-group">
                <input type="file" name="file[]" class="form-control" placeholder="Recipient's username" aria-describedby="basic-addon2" multiple="multiple">
                <div class="input-group-btn">
                    <input type="hidden" name="type" value="0" />
                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Action <span class="caret"></span></button>
                    <ul class="dropdown-menu dropdown-menu-right">
                        <li><a class="Utype" Utype="0" href="#">Upload</a></li>
                        <li><a class="Utype" Utype="1" href="#">Tp5Upload</a></li>
                        <li><a class="Utype" Utype="2" href="#">CurlUpload</a></li>
                        <li><a class="Utype" Utype="3" href="#">OssUpload</a></li>
                        <li><a class="Utype" Utype="4" href="#">QiniuUpload</a></li>
                        <!--<li role="separator" class="divider"></li>-->
                        <!--<li><a href="#">Separated link</a></li>-->
                    </ul>
                </div><!-- /btn-group -->
            </div>
        </form>
    </div>
    <!-- //container-wrap -->
</div>
<script type="text/javascript">
    $(function(){
        var up_url = "{:url('ext/upload/uType')}";
        $('.Utype').click(function(){
            var Utype = $(this).attr('Utype');
            var data = new FormData();

            $('input[name="type"]').val(Utype);//多余
            data.append('up_type',Utype);
            $.each($('input[name="file[]"]')[0].files,function(i,file){
                data.append('file[]',file);
            });

            $.ajax({
                url:up_url,
                type:'POST',
                data:data,
                cache:false,
                contentType:false,
                processData:false,
                success:function(res){
                    console.log(res);
                }
            });
        });
    })
</script>